<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>站级数据同步日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="出库单工具">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/icon.css">
<script type="text/javascript" src="<%=path%>/easyui/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/con_isok.js"></script>

</head>
<body class="easyui-layout">

	<div data-options="region:'north',border:false" style="padding:2px;">
		<table align="">
			<tr>
				<td>开始时间:</td>
				<td><input id="b_time_id" class="easyui-datetimebox" data-options="editable:false"></td>
				
				<td>结束时间:</td>
				<td><input id="e_time_id" class="easyui-datetimebox" data-options="editable:false"></td>
				
				<td>同步状态</td>
				<td><input id="syncStatusId" class="easyui-combobox" 
				data-options="valueField:'id',textField:'text',editable:false,data: [{
			id: '1',
			text: '成功'
		},{
			id: '0',
			text: '失败'
		}]"></td>
				
				<td align="right"><a id="select_btn" href="javascript:void(0);" class="easyui-linkbutton" onclick="selectData1();">查询</a>
				</td>
			</tr>
		</table>
	</div>
	
	<div data-options="region:'center',title:'日志记录', border:false" style="padding:2px;">
		<table id="dg" class="easyui-datagrid" data-options="
				url:'<%=path %>/sync/allsynclogs.do',
				fit:true,
				singleSelect:true,
				fitColumns: true,
				border:false,
				pagination: true
		">
			<thead>
				<tr>
					<th data-options="field:'stationCode',halign:'center', width:50, align:'center'">油站代码</th>
					<th data-options="field:'ip',halign:'center', width:50, align:'center'">ip地址</th>
					<th data-options="field:'stationName',halign:'center', width:60, align:'center'">油站名称</th>
					<th data-options="field:'message',halign:'center', width:110, align:'left'">同步详情</th>
					<th data-options="field:'insertTime',halign:'center', width:50, align:'center'">同步时间</th>
				</tr>
			</thead>
		</table>
	</div>
	

	<script type="text/javascript">
		
	
		$(function(){
			var myDate = new Date();
			var year = myDate.getFullYear();
			var month = myDate.getMonth() + 1;
			var bday = myDate.getDate()-3;
			var eday = myDate.getDate();
			
			$("#b_time_id").datetimebox('setValue', year +"-"+ month + "-" + bday + " 01:00:00");
			$("#e_time_id").datetimebox('setValue', year +"-"+ month + "-" + eday + " 01:00:00");
		});
	
		function selectData1(){
			isOkCon("", "<%=path%>","selectData()");
		}
		
		
		function selectData(){
			var btime = $("#b_time_id").datebox('getValue');
			console.log(btime)
			var etime = $("#e_time_id").datebox('getValue');
			var syncStatus = $("#syncStatusId").combobox("getValue");
			console.log(syncStatus);
			$("#dg").datagrid('load', {
				selectType:"1",
				btime:btime,
				etime:etime,
				syncStatus:syncStatus
			});
		}
		
		
	</script>
</body>
</html>
